import { defineComponent } from "vue";
import style from "./index.module.less";
import IconText from "../IconText";
import { messageItemProps } from "./types";
import icon from "./asset/icon.png";
import { getSize } from "@/command/apiTool";
export default defineComponent({
  name: "message-item",
  props: messageItemProps,
  emits: ["click"],
  setup(props, { emit }) {
    return () => {
      return (
        <div
          class={"flex items-center justify-between"}
          onClick={() => emit("click", props)}
        >
          <IconText url={icon} class="message" text={props.text} />
          {props.showRight && (
            <span class={"text-[12px] text-[#333]"}>{props.data}</span>
          )}
        </div>
      );
    };
  },
});
